import { getTCBInstance } from "../util/tcb";

const app = getTCBInstance();

// 获取用户信息
const getUserInfo = (data: IAnyObject): Promise<IAnyObject> => {
  return new Promise((resolve, reject) => {
    try {
      app.callFunction('getUserInfo', data).then((res: {result: { code: number, data: IAnyObject }}) => {
        const resData = res?.result?.data?.data || []
        resolve(resData);
      })
    } catch (error) {
      reject(error);
    }
  });
}

export default getUserInfo;